{# SPDX-FileCopyrightText: © 2014-2015 Siemens AG

   SPDX-License-Identifier: FSFAP
#}
{% import "include/macros.html.twig" as macro %}
<h3>{{ "Scanner details"|trans }}</h3>
{% if agentMap|length==0 %}
  {{ 'There is no successful scan for this upload, please schedule one license scanner on this upload.'|trans }}
{% elseif agentMap|length==1 %}
  {{ 'Only one revision of'|trans }} <b>{{ agentMap|first }}</b> {{ 'ran for this upload'|trans }}. <br/>
{% else %}
  <form action="{{ agentShowURI }}" method="post">
    <select class="form-control-sm" name="agentId" id="agentId">
      <option value="0">{{ 'Latest run of all available agents'|trans }}</option>
    {% for key, value in agentMap %}
      <option value="{{ key }}"{% if agentId == key %} selected="selected"{% endif %}>
        {{ value }}
      </option>
    {% endfor %}
    </select>
    <input type="submit" class="btn btn-default btn-sm" name="s" value="{{'Show'|trans}}"/>
  </form>
{% endif %}

{% for s in scanners %}
  {% if s.agentName != 'scancode' and s.agentName != 'reportImport' and s.agentName != 'spasht' %}
    <div style="border: 1px dashed gray;">
    {% include 'browse_license-agent.html.twig' with {
      'agentName':s.agentName,
      'successfulAgents':s.successfulAgents,
      'uploadId':s.uploadId,
      'agentName':s.agentName,
      'isAgentRunning':s.isAgentRunning,
      'currentAgentId':s.currentAgentId,
      'currentAgentRev':s.currentAgentRev}
    %}
    </div>
  {% endif %}
{% endfor %}
